extends Node2D
class_name JumpNum
onready var label=$Label
var velocity=Vector2()
onready var tween=$Tween
var timer=0
func _ready():
	velocity.x=rand_range(-50,50)
	velocity.y=rand_range(-110,-90)
	tween.interpolate_property(self,'scale',Vector2(0.8,0.8),Vector2(1.5,1.5),0.1,Tween.TRANS_QUAD)
	tween.interpolate_property(self,'scale',Vector2(1.5,1.5),Vector2(1,1),0.3,Tween.TRANS_QUAD)
	tween.start()
func setText(txt):
	label.text=txt
func _process(delta):
	position+=velocity*delta
	velocity.y+=200*delta
	timer+=delta
	if(timer<0.5):
		modulate.a=1
	else:
		modulate.a=0.7-(timer-0.5)
	if timer>1.3:
		queue_free()
